/* eslint-disable consistent-return */
/* eslint-disable react/react-in-jsx-scope */
import axios from 'axios';
import { routerRedux } from 'dva/router';
import moment from 'moment';
import cookie from './cookie';
import styles from './utils.less';

const global = {
  withoutPermission(dispatch) {
    if (!dispatch) {
      return null;
    }
    return dispatch(
      routerRedux.replace(
        `/team/${this.getCurrTeamName()}/region/${this.getCurrRegionName()}/Exception/403`
      )
    );
  },
  nFormatter(num, digits = 1) {
    const si = [
      { value: 1, symbol: '' },
      { value: 1e3, symbol: 'K' },
      { value: 1e6, symbol: 'M' },
      { value: 1e9, symbol: 'G' },
      { value: 1e12, symbol: 'T' },
      { value: 1e15, symbol: 'P' },
      { value: 1e18, symbol: 'E' }
    ];
    const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
    let i;
    for (i = si.length - 1; i > 0; i--) {
      if (num >= si[i].value) {
        break;
      }
    }
    return (num / si[i].value).toFixed(digits).replace(rx, '$1') + si[i].symbol;
  },
  removeCookie() {
    cookie.remove('team_name');
    cookie.remove('region_name');
    cookie.remove('team');
    cookie.remove('token');
    cookie.remove('appStore');
    cookie.remove('newbie_guide');
    cookie.remove('enterprise_edition');
    cookie.remove('platform_url');
  },
  putInstallClusterLog(enterpriseInfo, rainbondInfo, obj) {
    if (
      !enterpriseInfo ||
      (enterpriseInfo && enterpriseInfo.disable_install_cluster_log)
    ) {
      return null;
    }
    const defaultOptions = {
      credentials: 'same-origin',
      url: 'https://log.rainbond.com/log',
      method: 'post'
    };
    const stateMap = {
      initial: 'start',
      success: 'complete',
      running: 'complete',
      offline: 'failure'
    };

    if (obj.status) {
      obj.status = stateMap[obj.status] || obj.status;
    }
    try {
      defaultOptions.data = JSON.stringify({
        e_name: rainbondInfo.enterprise_alias,
        version: rainbondInfo.version && rainbondInfo.version.value,
        ...obj
      });
      defaultOptions.data = JSON.parse(defaultOptions.data);
      axios(defaultOptions);
    } catch (e) {
      console.log(e);
    }
  },
  putClusterInfoLog(eid, clusters) {
    const defaultOptions = {
      credentials: 'same-origin',
      url: 'https://log.rainbond.com/log',
      method: 'post'
    };
    try {
      defaultOptions.data = JSON.stringify({
        eid,
        cluster_sizes: clusters.length,
        cluster_types: clusters.map(cluster => {
          return cluster.provider;
        }),
        day: moment(new Date())
          .locale('zh-cn')
          .format('YYYYMMDD')
      });
      defaultOptions.data = JSON.parse(defaultOptions.data);
      axios(defaultOptions);
    } catch (e) {
      console.log(e);
    }
  },
  putRegistLog(info) {
    const defaultOptions = {
      credentials: 'same-origin',
      url: 'https://log.rainbond.com/log',
      method: 'post'
    };
    try {
      defaultOptions.data = JSON.stringify({
        eid: info.enterprise_id,
        e_name: info.enterprise_alias,
        real_name: info.real_name,
        phone: info.phone,
        version: info.version,
        email: info.email,
        day: moment(new Date())
          .locale('zh-cn')
          .format('YYYYMMDD')
      });
      defaultOptions.data = JSON.parse(defaultOptions.data);
      axios(defaultOptions);
    } catch (e) {
      console.log(e);
    }
  },
  putLog(info) {
    if (!info || (info && !info.enterprise_id)) {
      return null;
    }
    const defaultOptions = {
      credentials: 'same-origin',
      url: 'https://log.rainbond.com/log',
      method: 'post'
    };
    try {
      const { title, version } = info;
      defaultOptions.data = JSON.stringify({
        url: window.location.href,
        eid: info.enterprise_id,
        e_name: info.enterprise_alias,
        version: version.value,
        title: title.value,
        day: moment(new Date())
          .locale('zh-cn')
          .format('YYYYMMDD')
      });
      defaultOptions.data = JSON.parse(defaultOptions.data);
      axios(defaultOptions);
    } catch (e) {
      console.log(e);
    }
  },
  getCurrEnterpriseId() {
    const reg = /enterprise\/([^\/]+)/;
    const hash = window.location.hash || window.location.pathname || '';

    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  getCurrTeamName() {
    const reg = /team\/([^\/]+)/;
    const hash = window.location.hash || window.location.pathname || '';

    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  getComponentID() {
    const reg = /components\/([^\/]+)/;
    const hash = window.location.hash || window.location.pathname || '';

    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  getAppID(url) {
    const reg = /apps\/([^\/]+)/;
    const hash = url || window.location.hash || window.location.pathname || '';
    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  getCurrRegionName() {
    const reg = /region\/([^\/]+)/;
    const hash = window.location.hash || window.location.pathname || '';

    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  fetchStateColor(status) {
    const statusColorMap = {
      RUNNING: '#00D777', // 运行中 绿色
      running: '#00D777', // 运行中 绿色
      starting: '#F69D4A', // 启动中
      Starting: '#F69D4A', // 启动中
      NOTREADY: '#F69D4A', // 未就绪
      checking: 'F69D4A', // 检测中
      SCHEDULING: '#F69D4A', // 检测中
      stopping: '#20124A', // 关闭中 紫色
      Stopping: '#20124A', // 关闭中 紫色
      unusual: '#CD0200', // 异常 纯红
      ABNORMAL: '#CD0200', // 异常 纯红
      closed: '#000021', // 已关闭 黑色
      Closed: '#000021', // 已关闭 黑色
      undeploy: '#708090', // 未部署 石板灰
      Undeploy: '#708090', // 未部署 石板灰
      Unknow: '#CD0200', // 未知深粉色
      unknow: '#CD0200', // 未知/深粉色
      Creating: '#778899', // 部署中 浅石板灰
      creating: '#778899', // 部署中 浅石板灰
      Third_party: '#5BB2FA',
      Internet: '#5BB2FA', // 蓝色
      TheInternet: '#5BB2FA', // 蓝色
      Abnormal: '#CD0200', // 不正常,纯红
      abnormal: '#CD0200', // 不正常,纯红
      Build_failure: '#CD0200', // 构建失败 纯红
      build_failure: '#CD0200', // 构建失败 纯红
      Upgrade: '#00FF4A', // 升级中
      upgrade: '#00FF4A', // 升级中
      expired: '#CD0200', // 过期 猩红
      Expired: '#CD0200', // 猩红
      UNHEALTHY: '#CD0200',
      INITIATING: '#F69D4A',
      TEMINATING: '#20124A', // 关闭中 紫色
      tEMINATING: '#20124A', // 关闭中 紫色
      Some_abnormal: '#FF0000', // 一些不正常 纯红
      Building: '#007710' // 构建  纯蓝
    };
    return statusColorMap[status] || statusColorMap.unknow;
  },
  confirmEnding(str, target) {
    return str.indexOf(target) > -1 || str.indexOf(target.toLowerCase()) > -1;
  },
  fetchSvg(type, color) {
    const svgType = {
      arrowSvg: (
        <svg viewBox="0 0 6 12">
          <path d="M0 6L6 0L6 12z" fill="#298DF8" fillRule="evenodd" />
        </svg>
      ),
      promptSvg: (
        <svg viewBox="0 0 12 12">
          <path
            d="M1.707.293L5.95 4.535 10.192.293a1 1 0 011.415 1.414L7.364 5.95l4.243 4.243a1 1 0 01-1.415 1.415L5.95 7.364l-4.242 4.243a1 1 0 01-1.414-1.415L4.535 5.95.293 1.707A1 1 0 011.707.293z"
            fill="#FFF"
            fillRule="evenodd"
          />
        </svg>
      ),
      ClickSvg: (
        <svg width="32" height="32">
          <g fill="none" fillRule="evenodd">
            <path
              d="M31.766 24.021c-.205.69-.327 1.406-.639 2.033a7.09 7.09 0 01-1.293 1.838 16.497 16.497 0 01-5.402 3.587c-1.53.631-3.071.77-4.594-.072a2.297 2.297 0 01-1.117-1.332.737.737 0 00-.733-.593c-1.608-.19-3.216-.46-4.81-.675-1.108-.147-2.141-.042-3.168.57a11.946 11.946 0 01-4.418 1.59c-1.202.17-2.493-.083-3.026-1.198a5.475 5.475 0 01-.384-1.633 6.313 6.313 0 01.46-3.494c.655-1.422 1.838-2.236 3.258-2.739a13.044 13.044 0 014.213-.65h.82c-.508-.981-.919-1.902-1.44-2.757a24.021 24.021 0 00-3.462-4.34 136.095 136.095 0 01-2.987-3.12C2.072 9.985 1.134 8.782.687 7.348c-.172-.55-.241-1.13-.36-1.695-.024-.11-.07-.214-.102-.32v-.457c.06-.347.11-.69.182-1.036C.75 2.176 1.519.818 3.184.163c1.202-.46 2.479.078 3.306 1.282C7.685 3.2 8.918 4.92 10.131 6.644c.092.133.205.253.301.374.572-.413 1.1-.845 1.675-1.199 1.838-1.135 3.772-1.353 5.787-.434a.947.947 0 00.604-.028c.703-.23 1.379-.54 2.098-.723.894-.23 1.79-.02 2.607.32a9.238 9.238 0 014.076 3.174c1.994 2.819 3.336 5.92 3.471 9.42.046 1.238-.2 2.487-.335 3.73-.032.301-.048.49.278.69.648.392.919 1.07 1.073 1.79v.263z"
              fill="#FFF"
            />
            <path
              d="M31.766 24.021c-.205.69-.327 1.406-.639 2.033a7.09 7.09 0 01-1.293 1.838 16.497 16.497 0 01-5.402 3.587c-1.53.631-3.071.77-4.594-.072a2.297 2.297 0 01-1.117-1.332.737.737 0 00-.733-.593c-1.608-.19-3.216-.46-4.81-.675-1.108-.147-2.141-.042-3.168.57a11.946 11.946 0 01-4.418 1.59c-1.202.17-2.493-.083-3.026-1.198a5.475 5.475 0 01-.384-1.633 6.313 6.313 0 01.46-3.494c.655-1.422 1.838-2.236 3.258-2.739a13.044 13.044 0 014.213-.65h.82c-.508-.981-.919-1.902-1.44-2.757a24.021 24.021 0 00-3.462-4.34 136.095 136.095 0 01-2.987-3.12C2.072 9.985 1.134 8.782.687 7.348c-.172-.55-.241-1.13-.36-1.695-.024-.11-.07-.214-.102-.32v-.457c.06-.347.11-.69.182-1.036C.75 2.176 1.519.818 3.184.163c1.202-.46 2.479.078 3.306 1.282C7.685 3.2 8.918 4.92 10.131 6.644c.092.133.205.253.301.374.572-.413 1.1-.845 1.675-1.199 1.838-1.135 3.772-1.353 5.787-.434a.947.947 0 00.604-.028c.703-.23 1.379-.54 2.098-.723.894-.23 1.79-.02 2.607.32a9.238 9.238 0 014.076 3.174c1.994 2.819 3.336 5.92 3.471 9.42.046 1.238-.2 2.487-.335 3.73-.032.301-.048.49.278.69.648.392.919 1.07 1.073 1.79v.263zM15.454 12.394c-.873-.13-2.361-.919-3.388-1.87-1.77-1.642-3.148-3.623-4.574-5.57-.71-.982-1.356-2.011-2.05-3.004-.372-.53-.877-.875-1.56-.788-.824.106-1.378.644-1.782 1.31-.795 1.289-.869 2.67-.483 4.105.441 1.638 1.507 2.863 2.622 4.067 1.644 1.778 3.315 3.535 4.888 5.373a14.604 14.604 0 012.969 5.489c.17.595-.042.889-.662.896-.538 0-1.078-.012-1.608 0-1.4.041-2.775.209-4.073.78-1.298.573-2.21 1.517-2.39 2.962-.082.815-.076 1.637.019 2.451.085.92.549 1.27 1.468 1.28.239.002.478-.016.714-.055a12.34 12.34 0 004.255-1.608 4.46 4.46 0 012.934-.556c1.748.23 3.49.505 5.24.705 1.452.163 2.901.163 4.268-.487a20.428 20.428 0 005.027-3.42c.751-.69 1.491-1.418 1.81-2.418.509-1.664.677-3.413.497-5.143-.182-2.068-.89-3.957-1.813-5.785-.924-1.829-2.09-3.446-3.885-4.542-1.036-.627-2.127-1.055-3.36-.79-.507.141-1.004.312-1.49.512l2.527 2.267a3.278 3.278 0 01-.535-.151c-1.054-.559-2.136-1.073-3.147-1.705a4.574 4.574 0 00-4.207-.413 6.125 6.125 0 00-2.502 1.718c.529.602 1.004 1.2 1.54 1.74.903.911 1.84 1.793 2.738 2.65h-.007zm4.31 17.267c.15.46.39.71.947.935a3.906 3.906 0 002.81 0c2.067-.714 3.843-1.916 5.43-3.402a4.921 4.921 0 001.636-3.108c.064-.589-.145-.96-.538-1.15-2.697 3.406-5.878 5.98-10.278 6.725h-.007zm4.691-6.929c-.12.14-.23.391-.395.43a1.149 1.149 0 01-.627-.175c-.076-.034-.106-.174-.156-.266l-2.897-5.364c-.064-.12-.133-.23-.195-.354-.166-.322-.157-.637.181-.813.338-.177.607-.037.79.282.662 1.149 1.34 2.298 1.978 3.467.405.733.752 1.495 1.117 2.249.071.147.115.303.204.544zm2.008-1.681c0 .354-.149.581-.478.618a.494.494 0 01-.588-.428 22.973 22.973 0 00-1.318-4.594c-.157-.39 0-.724.314-.814a.54.54 0 01.703.384 21.928 21.928 0 011.349 4.678c.011.062.014.117.018.156zm-4.491 3.462c-.138.152-.25.388-.42.439a.703.703 0 01-.586-.154 6.733 6.733 0 01-.59-.843c-.614-.83-1.237-1.654-1.857-2.482a3.615 3.615 0 00-.23-.28c-.23-.294-.287-.6 0-.88.23-.23.602-.149.86.173.53.666 1.056 1.337 1.564 2.024.356.48.69.985 1.009 1.486.094.167.177.34.25.517z"
              fill="#000"
              fillRule="nonzero"
            />
          </g>
        </svg>
      ),
      HelmSvg: (
        <svg viewBox="0 0 1024 1024" p-id="1608" width="14" height="14">
          <path
            d="M1005.872 529.056l0-34.144-119.456 0c-3.424-92.16-39.264-174.08-97.28-238.944l85.344-85.344-23.904-23.904-85.344 85.344c-63.136-58.016-145.056-93.856-235.52-97.28l0-117.76-34.144 0 0 117.76c-90.464 3.424-172.384 40.96-235.52 97.28l-85.344-85.344-23.904 23.904 85.344 85.344c-59.744 64.864-97.28 146.784-100.704 238.944l-119.456 0 0 34.144 119.456 0c5.12 90.464 40.96 172.384 97.28 233.824l-85.344 85.344 23.904 23.904 85.344-85.344c63.136 58.016 145.056 93.856 235.52 97.28l0 122.88 34.144 0 0-121.184c90.464-3.424 174.08-40.96 235.52-97.28l85.344 85.344 23.904-23.904-85.344-85.344c56.32-63.136 93.856-143.36 97.28-233.824l122.88 0zM852.272 494.944l-204.8 0c-3.424-25.6-13.664-49.504-29.024-68.256l145.056-145.056c51.2 56.32 83.616 131.424 88.736 213.344zM510.96 614.4c-56.32 0-102.4-46.08-102.4-102.4s46.08-102.4 102.4-102.4c56.32 0 102.4 46.08 102.4 102.4s-46.08 102.4-102.4 102.4zM739.632 257.696l-146.784 146.784c-18.784-13.664-40.96-23.904-64.864-27.296l0-208.224c81.92 5.12 155.296 37.536 211.616 88.736zM493.872 168.96l0 206.496c-23.904 3.424-46.08 11.936-64.864 27.296l-146.784-146.784c56.32-49.504 129.696-81.92 211.616-87.04zM258.352 281.6l145.056 145.056c-15.36 18.784-25.6 42.656-29.024 68.256l-204.8 0c5.12-81.92 37.536-157.024 88.736-213.344zM171.312 529.056l204.8 0c3.424 23.904 11.936 46.08 27.296 64.864l-143.36 143.36c-52.896-54.624-85.344-128-88.736-208.224zM282.256 762.88l143.36-143.36c18.784 15.36 42.656 25.6 68.256 29.024l0 203.104c-81.92-5.12-155.296-37.536-211.616-88.736zM528.016 849.92l0-203.104c25.6-3.424 49.504-13.664 68.256-29.024l143.36 143.36c-56.32 52.896-129.696 85.344-211.616 88.736zM763.536 738.976l-143.36-143.36c13.664-18.784 23.904-40.96 27.296-64.864l204.8 0c-5.12 78.496-37.536 151.904-88.736 208.224z"
            p-id="1609"
            fill="#2c2c2c"
          />
        </svg>
      ),
      InstallApp: (
        <svg
          className="icon"
          viewBox="0 0 1024 1024"
          p-id="1959"
          width="26"
          height="26"
        >
          <path
            d="M686.023111 170.666667c19.607704 0 34.322963 4.835556 49.019259 14.525629l93.127111 101.736297c4.911407 0 4.911407 4.854519 4.911408 4.854518C857.581037 306.308741 872.296296 330.524444 872.296296 359.61363v402.090666C872.296296 800.464593 837.973333 834.37037 798.757926 834.37037H225.242074C186.026667 834.37037 151.703704 800.464593 151.703704 761.704296V359.61363c0-29.070222 14.715259-53.285926 44.126815-67.830519l4.892444-4.854518 98.038518-96.900741C308.565333 175.521185 328.173037 170.666667 347.780741 170.666667z m112.734815 164.712296H225.242074c-14.715259 0-24.519111 9.690074-24.519111 24.234667v402.090666c0 14.52563 9.803852 24.215704 24.519111 24.215704h573.515852c14.715259 0 24.519111-9.671111 24.519111-24.215704V359.61363c0-14.544593-9.803852-24.234667-24.519111-24.234667zM514.465185 383.829333c14.715259 0 24.519111 9.671111 24.519111 24.215704v184.092444l83.32326-77.501629a23.893333 23.893333 0 0 1 34.322963 0c9.803852 9.671111 9.803852 24.215704-4.911408 33.905778l-122.538667 116.261926c-4.911407 4.854519-9.803852 9.690074-19.607703 9.690074s-14.715259-4.835556-19.607704-9.671111l-122.55763-116.280889c-9.803852-9.671111-9.803852-24.215704 0-33.905778a23.893333 23.893333 0 0 1 34.322963 0l88.234667 77.501629v-184.092444c0-14.52563 9.803852-24.215704 24.500148-24.215704z m166.684445-164.712296H342.869333c-4.911407 0-9.803852 0-14.715259 4.835556l-63.715555 62.976h490.192592l-58.823111-62.957037c-4.911407-4.854519-9.803852-4.854519-14.715259-4.854519z"
            p-id="1960"
            fill="#999999"
          />
        </svg>
      ),
      dockerSvg: (
        <svg viewBox="0 0 50 50" version="1.1" width="60px" height="60px">
          <path
            style={{ fill: '#03A9F4' }}
            d="M 40 20 C 40.390625 18.265625 39.90625 16.21875 37.5 14 C 33.585938 17.542969 34.703125 21.226563 36 23 C 36 23 35.835938 24 32 24 C 28.164063 24 2 24 2 24 C 2 24 0.167969 40 18 40 C 33.59375 40 37.972656 27.996094 38.828125 24.925781 C 39.183594 24.972656 39.578125 25.003906 40 25 C 42.148438 24.984375 44.929688 23.828125 46 19.515625 C 43.160156 18.53125 41.339844 18.976563 40 20 Z "
          />
          <path
            style={{ fill: '#0288D1' }}
            d="M 2.164063 28 C 2.898438 32.738281 5.984375 40 18 40 C 30.183594 40 35.523438 32.671875 37.683594 28 Z "
          />
          <path
            style={{ fill: '#81D4FA' }}
            d="M 19.8125 39.9375 C 18.890625 39.617188 14.738281 38.847656 14 33 C 9.789063 34.863281 6.0625 34.375 4.421875 34.007813 C 6.582031 37.238281 10.589844 40 18 40 C 18.621094 40 19.222656 39.976563 19.8125 39.9375 Z "
          />
          <path
            style={{ fill: '#FFFFFF' }}
            d="M 20 32 C 20 33.105469 19.105469 34 18 34 C 16.894531 34 16 33.105469 16 32 C 16 30.894531 16.894531 30 18 30 C 19.105469 30 20 30.894531 20 32 Z "
          />
          <path
            style={{ fill: '#37474F' }}
            d="M 14.914063 33.597656 C 15.136719 34.101563 14.933594 34.757813 14.402344 34.914063 C 11.101563 35.886719 8.257813 36.015625 6.105469 36.015625 C 5.464844 35.398438 4.914063 34.738281 4.449219 34.054688 C 7.035156 34.054688 11.160156 33.933594 13.59375 33.089844 C 14.117188 32.90625 14.691406 33.089844 14.914063 33.597656 Z M 2 27 C 2 27 3.875 27.125 5 26 C 6.875 27.6875 10.941406 27.089844 12 26 C 13.0625 27.6875 18.9375 27.375 20 26 C 21.25 27.4375 26.625 27.75 28 26 C 28.480469 27.460938 34.820313 27.875 36 26 C 37.0625 27.089844 41.0625 27.9375 43.3125 26 C 43.875 27.1875 46 27 46 27 L 46 28 L 2 28 M 17 32 C 17 32.550781 17.449219 33 18 33 C 18.550781 33 19 32.550781 19 32 C 19 31.449219 18.550781 31 18 31 C 17.449219 31 17 31.449219 17 32 Z "
          />
          <path
            style={{ fill: '#01579B' }}
            d="M 11 24 L 6 24 L 6 19 L 11 19 Z M 21 19 L 16 19 L 16 24 L 21 24 Z M 31 19 L 26 19 L 26 24 L 31 24 Z M 16 14 L 11 14 L 11 19 L 16 19 Z M 26 14 L 21 14 L 21 19 L 26 19 Z "
          />
          <path
            style={{ fill: '#0288D1' }}
            d="M 16 24 L 11 24 L 11 19 L 16 19 Z M 26 19 L 21 19 L 21 24 L 26 24 Z M 26 9 L 21 9 L 21 14 L 26 14 Z M 21 14 L 16 14 L 16 19 L 21 19 Z "
          />
        </svg>
      ),
      codeSvg: (
        <svg width="60px" height="60px" viewBox="0 0 50 50" version="1.1">
          <path
            d="M31.157459,0.325985833 C30.9361049,0.1167225 30.6431362,0 30.3385417,0 L10.5952381,0 C7.30933786,0.0037202381 4.64657738,2.66648071 4.64285714,5.95238095 L4.64285714,44.047619 C4.64657738,47.3335193 7.30933786,49.9962798 10.5952381,50 L39.4140625,50 C42.6999629,49.9962798 45.3627232,47.3335193 45.3664435,44.047619 L45.3664435,14.297805 C45.3664435,13.9708892 45.2320499,13.6583892 44.9944196,13.4333148 L31.157459,0.325985833 Z M31.7145648,4.13364952 L41.109561,13.0333892 L32.905041,13.0333892 C32.2479538,13.032459 31.7150298,12.5 31.7145648,11.842913 L31.7145648,4.13364952 Z M39.4140625,47.6190476 L10.5952381,47.6190476 C8.6235119,47.6167225 7.02613464,46.0193452 7.02380952,44.047619 L7.02380952,5.95238095 C7.02613464,3.98065476 8.6235119,2.3832775 10.5952381,2.38095238 L29.3331474,2.38095238 L29.3331474,11.842913 C29.3354725,13.814174 30.9333148,15.4120164 32.904576,15.4143415 L42.9850261,15.4143415 L42.9850261,44.047619 C42.983166,46.0188802 41.3853237,47.6167225 39.4140625,47.6190476 Z"
            id="Shape"
            fill="#006DF0"
            fillRule="nonzero"
          />
          <path
            d="M31.8708148,26.7089844 C31.5987724,26.3778832 31.1700149,26.218378 30.7477679,26.2913876 C30.3259858,26.3643974 29.9753535,26.6582962 29.8302642,27.0614769 C29.6851749,27.4646577 29.7679501,27.9143415 30.046968,28.2393974 L33.1180245,31.9001117 L30.046968,35.560826 C29.7679501,35.8858817 29.6851749,36.3360305 29.8302642,36.7392113 C29.9753535,37.1419271 30.3259858,37.436291 30.7477679,37.5088356 C31.1700149,37.5818452 31.5987724,37.42234 31.8708148,37.0912388 L35.5850074,32.6655506 C35.9561012,32.2228423 35.9561012,31.577381 35.5850074,31.1351376 L31.8708148,26.7089844 Z"
            id="Shape"
            fill="#006DF0"
            fillRule="nonzero"
          />
          <path
            d="M16.890811,31.9001117 L19.9623326,28.2393974 C20.2413505,27.9143415 20.3241257,27.4646577 20.1790364,27.0614769 C20.0339471,26.6582962 19.6833148,26.3643974 19.2610677,26.2913876 C18.8392857,26.218378 18.4105283,26.3778832 18.1384858,26.7089844 L14.4247582,31.1351376 C14.0536644,31.577381 14.0536644,32.2228423 14.4247582,32.6655506 L18.1384858,37.0912388 C18.4105283,37.42234 18.8392857,37.5818452 19.2610677,37.5088356 C19.6833148,37.436291 20.0339471,37.1419271 20.1790364,36.7392113 C20.3241257,36.3360305 20.2413505,35.8858817 19.9623326,35.560826 L16.890811,31.9001117 Z"
            id="Shape"
            fill="#006DF0"
            fillRule="nonzero"
          />
          <path
            d="M26.3020833,23.3468192 C25.6524368,23.2482329 25.0451079,23.6951264 24.9465215,24.3452381 L22.7087983,39.0978423 C22.609747,39.7479538 23.0571057,40.3548177 23.7072173,40.453404 C23.7667411,40.4627046 23.8267299,40.4673549 23.8871838,40.4673549 C24.4749814,40.4664249 24.9744233,40.0367374 25.062779,39.4554501 L27.3005023,24.702381 C27.3995536,24.0522693 26.952195,23.4454055 26.3020833,23.3468192 Z"
            id="Shape"
            fill="#006DF0"
            fillRule="nonzero"
          />
        </svg>
      ),
      defaulAppImg: (
        <svg
          t="1619770328256"
          className="icon"
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="4852"
        >
          <path
            d="M416 576h-384C12.8 576 0 563.2 0 544v-512C0 12.8 12.8 0 32 0h384c19.2 0 32 12.8 32 32v512c0 19.2-12.8 32-32 32zM64 512h320V64H64v448zM992 1024h-384c-19.2 0-32-12.8-32-32v-512c0-19.2 12.8-32 32-32h384c19.2 0 32 12.8 32 32v512c0 19.2-12.8 32-32 32zM640 960h320V512h-320v448zM992 320h-384c-19.2 0-32-12.8-32-32v-256c0-19.2 12.8-32 32-32h384c19.2 0 32 12.8 32 32v256c0 19.2-12.8 32-32 32zM640 256h320V64h-320v192zM416 1024h-384c-19.2 0-32-12.8-32-32v-256c0-19.2 12.8-32 32-32h384c19.2 0 32 12.8 32 32v256c0 19.2-12.8 32-32 32zM64 960h320v-192H64v192z"
            fill="#14ADC4"
            p-id="4853"
          />
        </svg>
      ),
      vip: (
        <svg
          t="1585818847140"
          viewBox="0 0 1024 1024"
          p-id="2821"
          width="20"
          height="20"
        >
          <path
            d="M1007.669 323.675c0.481 8.367-2.411 16.732-8.204 23.327l-480.066 548.598 359.083-571.927h129.185z"
            fill="#2EB9EF"
            p-id="2822"
          />
          <path
            d="M1007.669 323.675h-129.185l-55.985-204.317c11.584 0.803 22.363 6.275 30.086 15.124l147.045 168.442c5.149 5.953 7.885 13.354 8.043 20.754z"
            fill="#44C9F2"
            p-id="2823"
          />
          <path
            d="M822.497 119.357l55.985 204.317h-166.189l-32.821-73.039 139.162-131.599c1.286 0 2.572 0 3.861 0.324z"
            fill="#2EB9EF"
            p-id="2824"
          />
          <path
            d="M878.484 323.675l-359.083 571.927 192.895-571.927zM818.636 119.036l-139.162 131.599-160.075-131.599z"
            fill="#46D3F9"
            p-id="2825"
          />
          <path
            d="M679.476 250.636l32.821 73.039h-192.895v-204.64z"
            fill="#5CD6F7"
            p-id="2826"
          />
          <path
            d="M712.295 323.675l-192.895 571.927v-571.927h7.241z"
            fill="#76E5FF"
            p-id="2827"
          />
          <path
            d="M519.241 323.675v571.927l-192.895-571.927h185.654z"
            fill="#3FC1EF"
            p-id="2828"
          />
          <path
            d="M519.241 119.036v204.64h-192.895l32.821-73.039z"
            fill="#76E5FF"
            p-id="2829"
          />
          <path
            d="M326.346 323.675l192.895 571.927-359.243-571.927z"
            fill="#46D3F9"
            p-id="2830"
          />
          <path
            d="M159.995 323.675l359.243 571.927-480.226-548.598c-5.791-6.595-8.687-14.961-8.204-23.327h129.185z"
            fill="#2EB9EF"
            p-id="2831"
          />
          <path
            d="M519.241 119.036l-160.075 131.599-139.321-131.599z"
            fill="#46D3F9"
            p-id="2832"
          />
          <path
            d="M359.164 250.636l-32.821 73.039h-166.35l55.985-204.317c1.286-0.324 2.572-0.324 3.861-0.324l139.321 131.599z"
            fill="#2EB9EF"
            p-id="2833"
          />
          <path
            d="M215.982 119.357l-55.985 204.317h-129.185c0.16-7.399 3.057-14.801 8.204-20.754l147.045-168.442c7.724-8.847 18.5-14.319 29.923-15.124z"
            fill="#44C9F2"
            p-id="2834"
          />
        </svg>
      ),
      free: (
        <svg
          t="1585879598597"
          viewBox="0 0 1025 1024"
          p-id="7186"
          width="18"
          height="18"
        >
          <path
            d="M1021.747 356.557l-2.355 2.253-493.67 658.33-4.608 4.607h-2.253c-1.536 1.536-3.789 2.253-6.861 2.253-3.072 0-5.325-0.717-6.86-2.253h-2.254l-4.608-4.608L4.608 358.81c-1.536 0-2.253-0.716-2.253-2.252v-2.253C0.717 352.768 0 351.232 0 349.696v-6.861l2.253-2.253c0-1.433 0.717-3.072 2.253-4.608v-2.252l256-256c3.072-1.434 5.324-2.253 6.86-2.253 1.536-1.434 3.79-2.253 6.861-2.253H749.67c3.072 0 5.325 0.82 6.861 2.253 1.536 0 3.072 0.819 4.608 2.253h2.253l256 256c1.536 3.072 2.253 5.324 2.253 6.86l2.355 2.253v6.861l-2.253 4.608v2.253z m-966.86 9.113L452.607 896l-192-530.33H54.886zM256 134.86L61.747 329.115H256V134.86z m214.835-25.19H292.557v192l178.278-192z m-171.417 256L512 950.886l212.582-585.113H299.418z m409.19-36.556L512 118.886 315.392 329.114h393.216z m22.835-219.444H553.165l178.278 192v-192zM571.392 896l397.722-530.33H763.392l-192 530.33z m390.86-566.886L768 134.86v194.253h194.253z"
            p-id="7187"
            fill="#ffffff"
          />
        </svg>
      ),
      cloudMarket: (
        <svg
          t="1592977834590"
          viewBox="0 0 1024 1024"
          p-id="15784"
          width="14"
          height="14"
        >
          <path
            d="M832 128 192 128C153.6 128 128 153.6 128 192l0 448c0 38.4 25.6 64 64 64l640 0c38.4 0 64-25.6 64-64L896 192C896 153.6 870.4 128 832 128zM864 614.4c0 32-25.6 57.6-57.6 57.6L217.6 672c-32 0-57.6-25.6-57.6-57.6L160 217.6c0-32 25.6-57.6 57.6-57.6l588.8 0c32 0 57.6 25.6 57.6 57.6L864 614.4z"
            p-id="15785"
            fill="#2c2c2c"
          />
          <path
            d="M640 832 608 832l0-128-192 0 0 128L384 832c-19.2 0-32 12.8-32 32C352 883.2 364.8 896 384 896l32 0 192 0L640 896c19.2 0 32-12.8 32-32C672 844.8 659.2 832 640 832z"
            p-id="15786"
            fill="#2c2c2c"
          />
          <path
            d="M736 268.8c-19.2 0-32 12.8-32 32 0 6.4 0 6.4 0 12.8L595.2 473.6c0 0 0 0-6.4 0-6.4 0-6.4 0-12.8 0L448 352c0 0 0-6.4 0-6.4 0-19.2-12.8-32-32-32C403.2 313.6 384 326.4 384 345.6c0 6.4 0 6.4 0 12.8L288 499.2c0 0 0 0 0 0C268.8 499.2 256 512 256 531.2c0 19.2 12.8 32 32 32S320 544 320 531.2c0-6.4 0-6.4 0-12.8l96-140.8c0 0 6.4 0 6.4 0 6.4 0 6.4 0 6.4 0l134.4 128c0 0 0 6.4 0 6.4 0 19.2 12.8 32 32 32s32-12.8 32-32c0-6.4 0-6.4 0-12.8l108.8-160c0 0 0 0 0 0C755.2 332.8 768 320 768 300.8 768 288 755.2 268.8 736 268.8z"
            p-id="15787"
            fill="#2c2c2c"
          />
        </svg>
      ),
      localMarket: (
        <svg
          t="1592977601179"
          viewBox="0 0 1024 1024"
          p-id="13469"
          width="14"
          height="14"
        >
          <path
            d="M721.9 94.2H302c-104.7 0-190 85.1-190 189.9v455.7c0 104.7 85.2 190 190 190h420c104.7 0 190-85.2 190-190V284.1c-0.1-104.8-85.3-189.9-190.1-189.9z m139.6 645.6c0 77-62.6 139.6-139.6 139.6H302c-77-0.1-139.6-62.7-139.6-139.6V284.1c0-77 62.6-139.6 139.6-139.6h420c77 0 139.6 62.6 139.6 139.6l-0.1 455.7z"
            p-id="13470"
            fill="#2c2c2c"
          />
          <path
            d="M642.5 354.9c-17.3 0-31.5 14.1-31.5 31.5 0 54.7-44.4 99.1-99.1 99.1s-99.1-44.4-99.1-99.1c0-17.3-14.1-31.5-31.5-31.5-17.3 0-31.5 14.1-31.5 31.5 0 89.4 72.7 162 162 162s162-72.7 162-162c0.2-17.5-13.9-31.5-31.3-31.5z"
            p-id="13471"
            fill="#2c2c2c"
          />
        </svg>
      ),
      uploads: (
        <svg viewBox="0 0 1024 1024" width="20" height="20">
          <path
            d="M983.679573 673.706667a26.88 26.88 0 0 0-27.093333 26.88v269.226666H67.412907V700.586667a26.666667 26.666667 0 0 0-26.88-26.88A27.093333 27.093333 0 0 0 13.439573 700.586667v296.32A27.093333 27.093333 0 0 0 40.532907 1024h942.933333a27.093333 27.093333 0 0 0 27.093333-27.093333V700.586667a26.666667 26.666667 0 0 0-26.88-26.88z"
            fill="#ffffff"
            p-id="2272"
          />
          <path
            d="M235.94624 342.826667L487.46624 91.306667v690.133333a27.093333 27.093333 0 0 0 53.973333 0V91.52l251.306667 251.306667a26.24 26.24 0 1 0 37.12-37.12L537.599573 13.226667a29.44 29.44 0 0 0-4.266666-5.333334 26.026667 26.026667 0 0 0-8.533334-5.76 29.653333 29.653333 0 0 0-10.666666-2.133333 28.586667 28.586667 0 0 0-10.453334 2.133333 26.026667 26.026667 0 0 0-8.746666 5.76 46.72 46.72 0 0 0-4.266667 5.333334L198.82624 305.706667a25.813333 25.813333 0 0 0 0 37.12 26.24 26.24 0 0 0 37.12 0z"
            fill="#ffffff"
            p-id="2273"
          />
        </svg>
      ),
      amplifications: (
        <svg viewBox="0 0 1024 1024" width="20" height="20">
          <path
            d="M537.7 420.2l277.8-287.9H557.9V64H928v377.1h-65.9V180.6l-277.8 288-46.6-48.4z m0 0M161.9 582.9v260.5l277.8-287.9 46.6 48.3-277.8 287.9h257.6V960H96V582.9h65.9z m0 0"
            fill="#ffffff"
            p-id="3232"
          />
        </svg>
      ),
      passwordShow: (
        <svg
          viewBox="64 64 896 896"
          focusable="false"
          data-icon="eye"
          width="1em"
          height="1em"
          fill="currentColor"
          aria-hidden="true"
        >
          <path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" />
        </svg>
      ),
      passwordHidden: (
        <svg
          viewBox="64 64 896 896"
          focusable="false"
          data-icon="eye-invisible"
          width="1em"
          height="1em"
          fill="currentColor"
          aria-hidden="true"
        >
          <path d="M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 0 0 0-51.5zm-63.57-320.64L836 122.88a8 8 0 0 0-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 0 0 0 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 0 0 0 11.31L155.17 889a8 8 0 0 0 11.31 0l712.15-712.12a8 8 0 0 0 0-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 0 0-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 0 1 146.2-106.69L401.31 546.2A112 112 0 0 1 396 512z" />
          <path d="M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 0 0 227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 0 1-112 112z" />
        </svg>
      ),
      application: (
        <svg
          width="40px"
          height="40px"
          viewBox="0 0 40 40"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
        >
          <g
            id="应用视图-总览"
            stroke="none"
            strokeWidth="1"
            fill="none"
            fillRule="evenodd"
          >
            <g
              id="应用视图"
              transform="translate(-101.000000, -117.000000)"
              fill="#1296DB"
              fillRule="nonzero"
            >
              <g id="编组" transform="translate(101.000000, 117.000000)">
                <path
                  d="M9.27551722,7.01349432e-05 C4.15848335,7.01349432e-05 0.00372962536,4.15803094 0.00372962536,9.27522519 C0.00372962536,14.3970696 4.15607808,18.5502199 9.27808287,18.5502199 L15.7098533,18.5502199 C17.2789103,18.5502199 18.5471445,17.2734869 18.5471445,15.7045903 L18.5471445,9.27265953 C18.5465031,4.15161683 14.3967203,7.01349432e-05 9.27551722,7.01349432e-05 Z M15.7082498,15.7045903 L15.7082498,15.7057128 C15.7090635,15.7077954 15.709707,15.7099404 15.7101741,15.7121495 L9.27808287,15.7121495 C6.66819785,15.7190058 4.31161857,14.1517228 3.30882288,11.7421693 C2.30602718,9.3326158 2.85485729,6.55617427 4.69901995,4.70939024 C6.5431826,2.86260621 9.31884175,2.3098329 11.7298172,3.30920497 C14.1407927,4.30857703 15.7114215,6.66292771 15.7082498,9.27281987 L15.7082498,15.7045903 Z M15.709212,21.2281198 L9.27808287,21.2281198 C4.15687984,21.2281198 0.00533314098,25.3791854 0.00533314098,30.5003884 C0.00533314098,35.6174223 4.15848335,39.7729778 9.27631898,39.7729778 C14.397522,39.7729778 18.5473048,35.6212708 18.5473048,30.5000677 L18.5473048,24.0682973 C18.5465031,22.49908 17.2781085,21.2281198 15.709212,21.2281198 Z M15.7082498,30.4999074 C15.7109758,33.0857609 14.1631833,35.4212282 11.7805563,36.4260839 C10.9892128,36.7607413 10.1471977,36.9267069 9.27808287,36.9267069 C8.40960946,36.9267069 7.56823575,36.7607413 6.77657156,36.4257632 C3.95286702,35.2383149 2.35859126,32.2240658 2.96625896,29.2217199 C3.57392665,26.219374 6.21486164,24.0623215 9.27808287,24.0662605 L15.7109758,24.0662605 C15.7103432,24.0662605 15.7096842,24.0662605 15.7090516,24.0662605 L15.7090516,30.499266 L15.7082498,30.4999074 Z M30.5442966,21.2281197 L24.1125261,21.2281197 C23.3592546,21.2281197 22.6367863,21.5271102 22.1041428,22.0597536 C21.5714994,22.592397 21.2725089,23.3148654 21.2725089,24.0681369 L21.2725089,30.4999074 C21.2725089,35.6211104 25.4235746,39.7726571 30.5447777,39.7726571 C35.6618115,39.7726571 39.817367,35.6174223 39.817367,30.5003884 C39.817367,25.3791854 35.6654996,21.2281197 30.5442966,21.2281197 L30.5442966,21.2281197 Z M36.4740009,33.001098 C35.2861041,35.825365 32.2712244,37.4199679 29.2681632,36.8123446 C26.265102,36.2047214 24.1072761,33.5635009 24.110758,30.4995867 L24.110758,24.066373 L30.5436552,24.066373 C32.6998426,24.0667719 34.7125897,25.1468281 35.9049864,26.9433063 C37.0973832,28.7397846 37.3110022,31.0139963 36.4740009,33.001098 L36.4740009,33.001098 Z M24.1125261,18.5502199 L30.5442966,18.5502199 C35.6654996,18.5502199 39.8170463,14.3970696 39.8170463,9.27506481 C39.8170463,4.15803094 35.6618115,0.00119264915 30.5447777,0.00119264915 C25.4235746,0.00119264915 21.272509,4.1514565 21.272509,9.27265953 L21.272509,15.70443 C21.272509,17.2734869 22.5434692,18.5502199 24.1125261,18.5502199 L24.1125261,18.5502199 Z M24.1107623,9.27265953 C24.1135957,5.71974823 26.9956581,2.84160943 30.54857,2.84361507 C34.1014819,2.8456228 36.9802913,5.72701533 36.9791118,9.27992757 C36.9779315,12.8328398 34.097209,15.7123197 30.5442966,15.7119666 L24.1107623,15.7119666 C24.1105385,15.709839 24.1105385,15.7076801 24.1107623,15.7055525 L24.1107623,9.27265953 L24.1107623,9.27265953 Z"
                  id="形状"
                />
              </g>
            </g>
          </g>
        </svg>
      ),
      component: (
        <svg
          t="1582714685365"
          className="icon"
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="2601"
          width="40"
          height="40"
        >
          <path
            d="M64 64h384v384H64V64z m0 512h384v384H64V576z m512 0h384v384H576V576z m192-128c106.039 0 192-85.961 192-192S874.039 64 768 64s-192 85.961-192 192 85.961 192 192 192z"
            p-id="2602"
            fill="#1296db"
          />
        </svg>
      ),
      logs: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566527207023"
          className={styles.iconm}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="5957"
          width="16"
          height="16"
        >
          <path
            d="M902.8 892l-95.5-96.3c62.4-95.5 35.6-223.5-59.9-285.9s-223.5-35.6-285.9 59.9-35.6 223.5 59.9 285.9c33.7 22 73.1 33.7 113.4 33.6 40.6-0.1 80.3-12.2 114-34.8l95.6 96.2c11.9 11.9 31.3 11.9 43.2 0l15.3-15.4c11.9-12.1 11.9-31.4 0-43.5l-0.1 0.3zM746.4 734.6C732 765 706 788.3 674.2 799.3c-12.7 5-26.2 7.4-39.8 6.9-69.6 1-126.7-54.6-127.7-124.2S561.4 555.3 631 554.3 757.7 609 758.6 678.5c0.3 19.5-4 38.7-12.4 56.2l0.2-0.1zM364.6 720H263.4c-17.5-0.7-31.2-15.5-30.5-33 0.7-16.6 13.9-29.8 30.5-30.5H363c2.5-29.2 9.8-57.8 21.4-84.6H263.5c-17.5-0.7-31.2-15.5-30.5-33 0.7-16.6 13.9-29.8 30.5-30.5h159.3c31.1-38.5 72.1-67.8 118.6-84.6H263.5c-17.5 0-31.8-14.2-31.7-31.8 0-17.5 14.2-31.7 31.7-31.7H749c17.5 0 31.8 14.2 31.7 31.8 0 17.5-14.2 31.7-31.7 31.7h-23.8c85.9 31.3 150.5 103.6 171.9 192.6V160.1c0.1-52.9-42.7-96-95.6-96.3H210.8c-52.9 0.4-95.5 43.3-95.5 96.2v687c0 52.9 42.7 95.9 95.6 96.2h346.4C455 912.9 379.7 825.7 364.6 720zM263.4 212.2H749c17.5 0.7 31.2 15.5 30.5 33-0.7 16.6-13.9 29.8-30.5 30.5H263.4c-17.5-0.7-31.2-15.5-30.5-33 0.7-16.6 14-29.8 30.5-30.5z"
            fill={color || '#000'}
            p-id="5958"
          />
        </svg>
      ),
      runTime: (
        <svg
          t="1567065687158"
          className={styles.iconm}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="19354"
          width="12"
          height="12"
        >
          <path
            d="M874.057143 150.016A508.635429 508.635429 0 0 0 512.073143 0.146286c-136.704 0-265.216 53.248-361.837714 149.942857A508.489143 508.489143 0 0 0 0.292571 512c0 136.777143 53.174857 265.289143 149.869715 362.057143A508.635429 508.635429 0 0 0 512 1023.780571c136.777143 0 265.362286-53.321143 362.057143-149.942857 199.533714-199.533714 199.606857-524.288 0-723.894857z m-49.444572 674.377143A439.296 439.296 0 0 1 512 954.075429a439.149714 439.149714 0 0 1-312.466286-129.462858A439.076571 439.076571 0 0 1 70.217143 512c0-118.052571 45.933714-229.083429 129.462857-312.539429A439.003429 439.003429 0 0 1 512 70.070857c118.125714 0 229.083429 45.933714 312.539429 129.462857a442.514286 442.514286 0 0 1 0 624.932572zM544.036571 535.186286V256.073143c0-23.552-11.410286-46.226286-34.962285-46.226286-23.552 0-38.034286 22.674286-38.034286 46.226286v298.569143c0 24.356571 30.281143 35.401143 51.638857 50.029714 14.262857 9.728 67.291429 41.837714 159.158857 96.329143 20.772571 10.825143 52.077714 25.088 65.682286 2.925714 13.531429-22.016-9.654857-45.933714-32.694857-60.708571-15.36-9.874286-72.265143-45.933714-170.788572-108.105143z"
            fill="#000000"
            p-id="19355"
          />
        </svg>
      ),
      distributionMemory: (
        <svg
          t="1565779336591"
          className={styles.icon}
          viewBox="0 0 1099 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="1890"
          width="16"
          height="16"
        >
          <path
            d="M841.66 313.7 676.06 189.2c-3.7-2.8-8.1-4.3-12.7-4.3L277.56 185c-8.5 0-16.7 5.9-16.7 16.8l0 618.8c0 13.9 12 27.2 27.3 27.2l552.2 0c8.8 0 14.8-4.3 14.8-14.2L855.16 330.1C855.06 323.4 847.06 317.7 841.66 313.7zM682.36 257.7l0 124.5c0 4.9-2.4 9.2-7.8 9.2l-262 0c-7.2 0-8.2-3.8-8.2-9.5l0-145.1 248.4 0L682.36 257.7zM804.66 778.6c0 10.7-6.5 18-16.9 18l-461 0c-8.1 0.1-13.5-5.8-13.5-14.5L313.26 248.4c0-7.1 6.6-11.5 15.3-11.5 7.5 0 17 0 27.7 0l0.1 190.4c0 6.9 4.3 10.1 10.8 10.1l346.1-0.1c6.8 0.1 10.7-5 10.5-12.7l0.1-135.2 80.8 60.4L804.66 778.6zM371.56 621.2l188.7 0c6.7 0 11.2-4.3 11.2-10.4 0-5.2 0-20.1 0-25.7 0-6.6-7-10.8-13.2-10.8L370.16 574.3c-7.8 0-11.7 4.9-11.7 10.8 0 6.4 0 21.7 0 25.4C358.46 616.5 363.16 621.2 371.56 621.2zM709.86 574.3l-95 0c-8.2 0-14.1 4.7-14.1 11.3 0 4.7 0 19 0 23.8 0 8.1 6.3 11.9 13.6 11.9l94.3 0c8.4 0 15.2-5.9 15.2-13.2 0-6.2 0-11.8 0-18.9C723.96 581.2 718.46 574.3 709.86 574.3zM480.06 698.5 371.76 698.5c-8.3 0-13.4 4.3-13.4 13.3 0 6 0 12.2 0 17.3 0 8.9 5.4 14.4 13.7 14.4l105.6 0c7.9 0 15.1-5.3 15.1-14 0-6.7 0-11.6 0-16.3C492.76 705 486.06 698.5 480.06 698.5zM709.06 698.5 533.56 698.5c-8.9 0-14.2 6.5-14.2 14.1 0 4.4 0 12.5 0 17.3 0 6.2 5.6 13.6 14.5 13.6l174 0c8.9 0 16-6.3 16-15.4 0-4.1 0-8.7 0-14.9C723.96 704.8 718.66 698.5 709.06 698.5zM627.46 360.4c7.3 0 13.2-6.1 13.2-11.4L640.66 277.4c0-7.4-4.1-11.5-10.3-11.5-5.1 0-24.9 0-29.3 0-6.2 0-9.2 4.5-9.2 11.4l0 71.9c0 6.4 6.3 11.3 11.9 11.3C608.56 360.4 622.06 360.4 627.46 360.4z"
            p-id="1891"
          />
        </svg>
      ),
      useDisk: (
        <svg
          style={{ marginRight: '6px' }}
          t="1566640777774"
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="20451"
          width="15"
          height="14"
        >
          <path
            d="M615.7 82H67v860h890V368.4L615.7 82z m-317.1 50h298.9l2.1 1.7v214.9h-301V132zM724 892H298.6V642.6H724V892z m183 0H774V592.6H248.6V892H117V132h131.6v266.6h401v-223l257.5 216V892zM353.1 192.1h50v80h-50v-80z"
            p-id="20452"
          />
        </svg>
      ),
      version: (
        <svg
          t="1565853114924"
          className={styles.icon}
          viewBox="0 0 1184 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="6049"
          width="16"
          height="16"
        >
          <path
            d="M448.576 576l118.272 0q-8 90.272-56.288 142.016t-122.56 51.712q-92.576 0-145.44-66.272t-52.864-180.576q0-110.848 53.152-178.016t133.152-67.136q84.576 0 132.576 49.728t55.424 141.152l-116 0q-2.848-36.576-20.288-56.576t-46.56-20q-32.576 0-50.56 34.56t-18.016 101.44q0 27.424 2.848 48t10.272 39.712 22.848 29.44 37.728 10.272q54.272 0 62.272-79.424zM855.424 576l117.728 0q-8 90.272-56 142.016t-122.272 51.712q-92.576 0-145.44-66.272t-52.864-180.576q0-110.848 53.152-178.016t133.152-67.136q84.576 0 132.576 49.728t55.424 141.152l-116.576 0q-2.272-36.576-20-56.576t-46.272-20q-32.576 0-50.56 34.56t-18.016 101.44q0 27.424 2.848 48t10.272 39.712 22.56 29.44 37.44 10.272q28 0 43.712-21.728t19.136-57.728zM1060.576 508q0-118.272-8.864-175.424t-34.56-92q-3.424-4.576-7.712-8t-12.288-8.576-9.152-6.272q-49.152-36-398.272-36-357.152 0-405.728 36-2.848 2.272-10.016 6.56t-12 8-8.288 8.288q-25.728 34.272-34.272 91.136t-8.576 176.288q0 118.848 8.576 175.712t34.272 91.712q3.424 4.576 8.576 8.576t11.712 8 10.016 6.848q25.152 18.848 136.864 28t268.864 9.152q348.576 0 398.272-37.152 2.848-2.272 9.728-6.272t11.712-8 7.712-9.152q26.272-34.272 34.848-90.848t8.576-176.576zM1170.272 73.152l0 877.728-1170.272 0 0-877.728 1170.272 0z"
            p-id="6050"
          />
        </svg>
      ),
      warehouse: (
        <svg
          t="1567065405232"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="11295"
          width="16"
          height="16"
        >
          <path
            d="M960 448h-267.168a191.744 191.744 0 0 0-361.6 0H64v128h267.168a191.744 191.744 0 0 0 361.6 0H960z m-448 192a128 128 0 1 1 128-128 128 128 0 0 1-128 128z"
            fill="#000000"
            p-id="11296"
          />
        </svg>
      ),

      basicInfo: (
        <svg
          t="1567065519867"
          className={styles.iconm}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="18494"
          width="12"
          height="12"
        >
          <path
            d="M980.76306 840.106926c0 101.570274-82.384097 183.893074-183.893073 183.893074s-183.893074-82.322799-183.893074-183.893074c0-79.993487 51.367465-147.298352 122.595382-172.614298V349.725396c0-33.897623-27.400068-61.297691-61.297691-61.297691v61.236393a61.338556 61.338556 0 0 1-104.635159 43.398766l-122.595382-122.656681A61.032068 61.032068 0 0 1 429.083839 227.068716c0-15.630911 6.007174-31.32312 17.960224-43.27617l122.595382-122.595383A61.256826 61.256826 0 1 1 674.274604 104.473333V165.832322c101.508977 0 183.893074 82.322799 183.893074 183.893074v317.767232c71.227917 25.315946 122.595383 92.620812 122.595382 172.614298z m-183.893073-61.297691c-33.897623 0-61.297691 27.400068-61.297692 61.297691s27.400068 61.297691 61.297692 61.297691 61.297691-27.400068 61.297691-61.297691-27.400068-61.297691-61.297691-61.297691z m-429.083839 61.297691c0 101.570274-82.322799 183.893074-183.893074 183.893074s-183.893074-82.322799-183.893074-183.893074c0-79.993487 51.306168-147.298352 122.595383-172.614298V399.744312C51.306168 374.428366 0 307.1235 0 227.130013c0-101.570274 82.322799-183.893074 183.893074-183.893073s183.893074 82.322799 183.893074 183.893073c0 79.993487-51.306168 147.298352-122.595383 172.614299v267.687018c71.289215 25.377244 122.595383 92.682109 122.595383 172.675596zM183.893074 165.832322a61.297691 61.297691 0 1 0 0 122.595383 61.297691 61.297691 0 1 0 0-122.595383z m0 612.976913a61.297691 61.297691 0 1 0 0 122.595382 61.297691 61.297691 0 1 0 0-122.595382z"
            p-id="18495"
            fill="#000000"
          />
        </svg>
      ),
      branch: (
        <svg
          t="1567065220584"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="2245"
          width="16"
          height="16"
        >
          <path
            d="M863 192.050c0-63-51.3-114.3-114.3-114.3s-114.3 51.3-114.3 114.3c0 54.9 39.15 100.8 90.9 111.6-7.65 118.35-88.2 190.8-213.3 190.8-90.45 0-153 44.1-190.35 82.35v-272.7c52.2-10.8 91.35-56.7 91.35-112.050 0-63-51.3-114.3-114.3-114.3s-113.85 51.3-113.85 114.3c0 55.35 39.6 101.25 91.8 112.050v416.25c-52.2 10.35-91.8 56.7-91.8 112.050 0 63 51.3 114.3 114.3 114.3s113.85-51.75 113.85-114.75c0-55.35-39.6-101.25-91.8-112.050v-71.55c13.5-21.6 75.15-108.9 190.35-108.9 76.95 0 141.75-24.3 188.55-70.2 42.3-41.85 66.15-98.55 70.2-165.15 53.1-10.35 92.7-56.7 92.7-112.050zM229.85 192.050c0-38.25 31.050-69.3 69.3-69.3s69.3 31.050 69.3 69.3-31.050 69.3-69.3 69.3-69.3-31.050-69.3-69.3zM368 831.95c0 38.25-31.050 69.3-69.3 69.3s-69.3-31.050-69.3-69.3 31.050-69.3 69.3-69.3 69.3 31.050 69.3 69.3zM748.7 261.35c-38.25 0-69.3-31.050-69.3-69.3s31.050-69.3 69.3-69.3 69.3 31.050 69.3 69.3-31.050 69.3-69.3 69.3z"
            fill="#000000"
            p-id="2246"
          />
        </svg>
      ),
      logState: (
        <svg
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="26201"
          width="16"
          height="16"
        >
          <path
            d="M951.509333 507.2L465.194667 993.514667c-0.682667 1.024-1.130667 2.176-2.026667 3.072a20.8 20.8 0 0 1-15.253333 5.994666 20.8 20.8 0 0 1-15.253334-5.994666c-0.896-0.896-1.322667-2.048-2.026666-3.072L73.066667 635.946667c-1.024-0.682667-2.154667-1.130667-3.072-2.026667A20.8 20.8 0 0 1 64 618.666667a20.693333 20.693333 0 0 1 5.994667-15.253334c0.917333-0.896 2.048-1.322667 3.072-2.026666L559.381333 115.093333A20.906667 20.906667 0 0 1 575.914667 106.666667h86.528c2.837333-32.042667 15.914667-60.16 35.626666-78.570667l0.341334 0.384c4.181333-4.416 9.877333-7.146667 16.170666-7.146667 12.629333 0 22.869333 10.922667 22.869334 24.384 0 8-3.84 14.741333-9.408 19.178667-10.218667 9.429333-17.493333 24.298667-19.925334 41.770667h102.464c6.826667 0 12.672 3.413333 16.533334 8.426666l124.373333 124.373334a20.992 20.992 0 0 1 8.426667 16.554666V490.666667a20.906667 20.906667 0 0 1-8.405334 16.533333z m-220.757333-151.658667a22.101333 22.101333 0 0 1-16.170667 7.125334c-12.629333 0-22.826667-10.922667-22.826666-24.384 0-8 3.84-14.741333 9.408-19.2 5.290667-4.885333 9.621333-11.456 13.162666-18.837334-18.24 4.864-31.744 21.333333-31.744 41.066667a42.666667 42.666667 0 0 0 85.333334 0c0-10.090667-3.626667-19.221333-9.493334-26.538667-13.12 33.002667-27.669333 40.768-27.669333 40.768z m186.496-91.413333L802.453333 149.333333h-89.877333c3.712 9.472 9.045333 17.536 15.466667 23.466667 0.874667 0.704 1.962667 1.130667 2.709333 1.962667l0.384-0.384c22.208 20.757333 36.8 53.504 36.8 90.752 0 0.896-0.213333 1.685333-0.256 2.56 25.536 14.741333 42.922667 42.026667 42.922667 73.642666a85.333333 85.333333 0 0 1-170.666667 0 85.141333 85.141333 0 0 1 81.493333-84.949333c-1.92-18.944-9.408-35.157333-20.245333-45.184-0.874667-0.704-1.962667-1.130667-2.752-1.962667l-0.341333 0.384C682.218667 194.794667 670.506667 173.674667 664.96 149.333333h-80.917333l-469.333334 469.333334 333.205334 333.205333 469.333333-469.333333V264.128zM304.682667 582.08a20.842667 20.842667 0 0 1 29.461333 0l150.378667 150.378667a20.842667 20.842667 0 0 1-29.461334 29.461333l-150.378666-150.378667a20.842667 20.842667 0 0 1 0-29.461333z m85.333333-85.333333a20.842667 20.842667 0 0 1 29.461333 0l150.357334 150.378666a20.842667 20.842667 0 0 1-29.461334 29.461334l-150.357333-150.378667a20.842667 20.842667 0 0 1 0-29.461333z"
            fill={color || '#000'}
            p-id="26202"
          />
        </svg>
      ),
      createTime: (
        <svg
          t="1567066044003"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="4001"
          width="16"
          height="16"
        >
          <path
            d="M720.32 257.344l-403.648-0.576a21.632 21.632 0 1 1 0-43.2l403.648 0.512a21.632 21.632 0 0 1 0 43.264z"
            p-id="4002"
            fill="#000000"
          />
          <path
            d="M882.88 921.344H143.808c-33.6 0-57.152-19.584-57.152-47.68V261.76c0-27.968 24-48.192 57.152-48.192H212.48a21.632 21.632 0 1 1 0 43.264H143.808c-6.528 0-13.824 2.112-13.824 4.992v611.968c0.64 1.728 5.248 4.416 13.824 4.416h739.072a11.136 11.136 0 0 0 11.136-11.136v-599.04a11.136 11.136 0 0 0-11.136-11.136h-71.488a21.632 21.632 0 0 1 0-43.264h71.488a54.4 54.4 0 0 1 54.4 54.4v599.04a54.4 54.4 0 0 1-54.4 54.272z"
            p-id="4003"
            fill="#000000"
          />
          <path
            d="M915.648 413.568H114.816a21.632 21.632 0 1 1 0-43.264h800.768a21.632 21.632 0 0 1 0.064 43.264zM264.576 309.44a21.632 21.632 0 0 1-21.632-21.632V170.624a21.632 21.632 0 1 1 43.264 0v117.184a21.632 21.632 0 0 1-21.632 21.632zM772.352 309.44a21.568 21.568 0 0 1-21.632-21.632V170.624c0-11.968 9.6-21.632 21.632-21.632s21.632 9.664 21.632 21.632v117.184c0 11.968-9.6 21.632-21.632 21.632zM416.512 504.384c51.712 0 82.624 30.08 82.624 75.264 0 92.608-143.232 119.616-143.232 165.888h134.72a12.032 12.032 0 0 1 0 24.064H341.632a12.096 12.096 0 0 1-11.968-12.032c0-84.928 143.616-94.144 143.616-177.856 0-29.824-20.096-52.16-56.768-52.16-32 0-45.952 16.256-54.784 35.52-2.368 4.992-6.144 7.744-11.2 7.744a12.032 12.032 0 0 1-11.2-16.256c10.432-31.296 37.44-50.176 77.184-50.176zM539.648 690.816c0-33.28 16.96-57.856 45.504-68.672-17.28-9.28-33.984-25.472-33.984-56 0-46.272 32.064-67.072 78.72-67.072 46.72 0 78.72 20.8 78.72 67.072 0 30.592-16.576 46.72-33.984 56 28.608 10.816 45.632 35.456 45.632 68.672 0 52.48-36.672 78.72-90.368 78.72-53.568 0-90.24-26.24-90.24-78.72z m25.472 0c0 38.656 26.624 55.616 64.832 55.616s64.96-17.024 64.96-55.616c0-38.272-24.448-55.936-64.96-55.936s-64.832 17.664-64.832 55.936z m11.648-124.672c0 30.592 20.8 45.568 53.184 45.568 32.448 0 53.312-14.976 53.312-45.568 0-29.696-20.032-43.968-53.312-43.968-33.216 0-53.184 14.272-53.184 43.968z"
            p-id="4004"
            fill="#000000"
          />
        </svg>
      ),
      currentVersion: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566532978509"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="10598"
          width="16"
          height="16"
        >
          <path
            d="M512 42.666667C251.733333 42.666667 42.666667 251.733333 42.666667 512s209.066667 469.333333 469.333333 469.333333 469.333333-209.066667 469.333333-469.333333S772.266667 42.666667 512 42.666667z m0 874.666666C288 917.333333 106.666667 736 106.666667 512S288 106.666667 512 106.666667s405.333333 181.333333 405.333333 405.333333-181.333333 405.333333-405.333333 405.333333z"
            p-id="10599"
            fill="#1296db"
          />
          <path
            d="M544 279.466667c-10.666667 10.666667-14.933333 23.466667-14.933333 40.533333 0 12.8 4.266667 23.466667 12.8 32 8.533333 8.533333 19.2 12.8 32 12.8 10.666667 0 23.466667-2.133333 38.4-17.066667 10.666667-10.666667 14.933333-25.6 14.933333-40.533333 0-12.8-4.266667-23.466667-12.8-32-19.2-19.2-51.2-17.066667-70.4 4.266667zM556.8 644.266667c-14.933333 14.933333-25.6 23.466667-34.133333 29.866666 4.266667-19.2 12.8-57.6 34.133333-130.133333 21.333333-72.533333 23.466667-87.466667 23.466667-91.733333 0-10.666667-4.266667-21.333333-12.8-27.733334-17.066667-14.933333-49.066667-12.8-87.466667 10.666667-21.333333 12.8-44.8 32-68.266667 59.733333l-12.8 14.933334 44.8 34.133333 10.666667-10.666667c12.8-12.8 21.333333-19.2 25.6-25.6-34.133333 110.933333-49.066667 179.2-49.066667 209.066667 0 14.933333 4.266667 25.6 12.8 34.133333 8.533333 8.533333 19.2 12.8 32 12.8s27.733333-4.266667 44.8-14.933333c17.066667-8.533333 40.533333-29.866667 74.666667-61.866667l12.8-12.8-40.533333-38.4-10.666667 8.533334z"
            p-id="10600"
            fill="#1296db"
          />
        </svg>
      ),
      upgrade: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566533552365"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="11396"
          width="16"
          height="16"
        >
          <path
            d="M512 57.6c249.6 0 454.4 204.8 454.4 454.4s-204.8 454.4-454.4 454.4S57.6 761.6 57.6 512 262.4 57.6 512 57.6M512 0C230.4 0 0 230.4 0 512s230.4 512 512 512 512-230.4 512-512-230.4-512-512-512z"
            p-id="11397"
            fill="#000000"
          />
          <path
            d="M326.4 492.8l160-160v428.8c0 19.2 12.8 32 32 32s32-12.8 32-32V332.8l160 160c12.8 12.8 32 12.8 44.8 0s12.8-32 0-44.8L531.2 243.2s-6.4-6.4-12.8-6.4h-25.6c-6.4 0-6.4 6.4-12.8 6.4L281.6 448c-12.8 12.8-12.8 32 0 44.8s32 12.8 44.8 0z"
            p-id="11398"
            fill="#000000"
          />
        </svg>
      ),
      rollback: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566533701108"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="14118"
          width="16"
          height="16"
        >
          <path
            d="M416 640V384H512v185.6l115.2 32-25.6 89.6-185.6-51.2zM512 102.4c243.2 0 448 198.4 448 448s-198.4 448-448 448-448-198.4-448-448c0-89.6 19.2-172.8 76.8-243.2l64 44.8c-38.4 57.6-57.6 128-57.6 198.4 0 198.4 166.4 364.8 364.8 364.8s364.8-166.4 364.8-364.8S710.4 185.6 512 185.6v102.4L326.4 147.2 512 0v102.4z"
            p-id="14119"
            fill="#000000"
          />
        </svg>
      ),
      delete: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566533607654"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="11648"
          width="16"
          height="16"
        >
          <path
            d="M950.857143 219.428571h-182.857143V73.142857h-512v146.285714H73.142857v73.142858h109.714286v658.285714h658.285714V292.571429H950.857143V219.428571zM329.142857 146.285714h365.714286v73.142857h-365.714286V146.285714z m438.857143 731.428572h-512V292.571429h146.285714v438.857142h73.142857V292.571429h73.142858v438.857142h73.142857V292.571429h146.285714v585.142857z"
            p-id="11649"
            fill="#000000"
          />
        </svg>
      ),
      success: (
        <svg
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="31270"
          width="16"
          height="16"
        >
          <path
            d="M927.97968 108.360629a50.575037 50.575037 0 0 0-69.085501 18.517689l-391.898737 678.933747-316.000056-182.409708A50.575037 50.575037 0 0 0 100.427574 711.005546l359.812488 207.690002a50.553362 50.553362 0 0 0 69.078276-18.517689L946.504593 177.44613a50.575037 50.575037 0 0 0-18.524913-69.085501z"
            fill="#46AF60"
            p-id="31271"
          />
        </svg>
      ),
      error: (
        <svg
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="32079"
          width="16"
          height="16"
        >
          <path
            d="M 909.812 962.028 c -13.094 0 -26.188 -4.996 -36.179 -14.987 L 73.958 147.368 c -19.98 -19.98 -19.98 -52.378 0 -72.359 c 19.983 -19.98 52.38 -19.98 72.36 0 L 945.99 874.683 c 19.981 19.981 19.981 52.378 0 72.36 c -9.99 9.99 -23.084 14.985 -36.179 14.985 Z"
            fill="#db4545"
            p-id="32080"
          />
          <path
            d="M 110.138 962.028 c -13.094 0 -26.188 -4.996 -36.179 -14.987 c -19.98 -19.98 -19.98 -52.378 0 -72.359 L 873.632 75.01 c 19.982 -19.98 52.377 -19.98 72.36 0 c 19.98 19.981 19.98 52.378 0 72.36 L 146.316 947.041 c -9.99 9.99 -23.084 14.986 -36.179 14.986 Z"
            fill="#db4545"
            p-id="32081"
          />
        </svg>
      ),
      close: (
        <svg
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="43063"
          width="16"
          height="16"
        >
          <path
            d="M511.998049 66.069397c-246.273427 0-445.926662 199.653235-445.926662 445.926462s199.653035 445.931458 445.926662 445.931458c246.296411 0 445.926462-199.658032 445.926462-445.931458S758.29446 66.069397 511.998049 66.069397zM511.998049 920.100164c-225.395582 0-408.104305-182.709523-408.104305-408.104305 0-225.395582 182.708723-408.105305 408.104305-408.105305 225.41357 0 408.125291 182.709723 408.125291 408.105305C920.12334 737.410428 737.411619 920.100164 511.998049 920.100164zM816.163025 803.452451 233.172693 196.400632l-25.336822 23.633976 583.593923 607.556477L816.163025 803.452451z"
            p-id="43064"
            fill="#9d9d9d"
          />
        </svg>
      )
    };
    return svgType[type] || type;
  },
  fetchStateBJColor(status) {
    const statusColorMap = {
      running:
        'linear-gradient(to right, #00D777 0, #00D777 10px, #fff 10px, #fff 100%) no-repeat', // 运行中 绿色
      starting:
        'linear-gradient(to right, #F69D4A 0, #F69D4A 10px, #fff 10px, #fff 100%) no-repeat', // 启动中
      checking:
        'linear-gradient(to right, #F69D4A 0, #F69D4A 10px, #fff 10px, #fff 100%) no-repeat', // 检测中
      stopping:
        'linear-gradient(to right, #20124A 0, #20124A 10px, #fff 10px, #fff 100%) no-repeat', // 关闭中 紫色
      unusual:
        'linear-gradient(to right, #CD0200 0, #CD0200 10px, #fff 10px, #fff 100%) no-repeat', // 异常
      closed:
        'linear-gradient(to right, #000021 0, #000021 10px, #fff 10px, #fff 100%) no-repeat', // 已关闭
      undeploy:
        'linear-gradient(to right, #708090 0, #708090 10px, #fff 10px, #fff 100%) no-repeat', // 未部署 石板灰
      unKnow:
        'linear-gradient(to right, #CD0200 0, #CD0200 10px, #fff 10px, #fff 100%) no-repeat', // 未知
      upgrade:
        'linear-gradient(to right, #00FF4A 0, #00FF4A 10px, #fff 10px, #fff 100%) no-repeat', // 升级中
      creating:
        'linear-gradient(to right, #778899 0, #778899 10px, #fff 10px, #fff 100%) no-repeat', // 部署中
      expired:
        'linear-gradient(to right, #CD0200 0, #CD0200 10px, #fff 10px, #fff 100%) no-repeat' // 过期
    };
    return statusColorMap[status] || statusColorMap.unKnow;
  },
  fetchStateText(state) {
    const statusColorMap = {
      RUNNING: '运行中',
      running: '运行中',
      starting: '启动中',
      checking: '检测中',
      stopping: '关闭中',
      unusual: '运行异常',
      closed: '已关闭',
      undeploy: '未部署',
      unKnow: '未知',
      UNKNOWN: '未知',
      ABNORMAL: '运行异常',
      TEMINATING: '关闭中',
      INITIATING: '等待启动',
      SCHEDULING: '调度中',
      TheInternet: '未知',
      upgrade: '升级中',
      creating: '部署中',
      expired: '过期',
      NOTREADY: '未就绪',
      UNHEALTHY: '不健康'
    };
    return statusColorMap[state] || statusColorMap.TheInternet;
  },
  fetchGovernanceMode(state) {
    const GovernanceMode = {
      KUBERNETES_NATIVE_SERVICE: '原生 service 模式',
      BUILD_IN_SERVICE_MESH: '内置 ServiceMesh 模式'
    };
    return GovernanceMode[state] || '-';
  },
  fetchTime(value) {
    const second = value; // 时间差的毫秒数
    let result = '';

    // 计算出相差天数
    const days = Math.floor(second / (24 * 3600 * 1000));

    // 计算出小时数

    const leave1 = second % (24 * 3600 * 1000); // 计算天数后剩余的毫秒数
    const hours = Math.floor(leave1 / (3600 * 1000));
    // 计算相差分钟数
    const leave2 = leave1 % (3600 * 1000); // 计算小时数后剩余的毫秒数
    const minutes = Math.floor(leave2 / (60 * 1000));

    // 计算相差秒数
    const leave3 = leave2 % (60 * 1000); // 计算分钟数后剩余的毫秒数
    const seconds = Math.round(leave3 / 1000);

    if (days && days >= 1) {
      result += `${days}天`;
    }
    if (hours && hours >= 1) {
      result += `${hours}小时`;
    }

    if (minutes && minutes >= 1) {
      result += `${minutes}分钟`;
    }

    if (seconds && seconds >= 1) {
      result += `${seconds}秒`;
    }
    return result || '1秒';
  },
  fetchdayTime(date) {
    const second = Date.parse(new Date()) - new Date(date).getTime();
    // 计算出相差天数
    const days = Math.floor(second / (24 * 3600 * 1000));
    // 计算出小时数

    const leave1 = second % (24 * 3600 * 1000); // 计算天数后剩余的毫秒数
    const hours = Math.floor(leave1 / (3600 * 1000));
    // 计算相差分钟数
    const leave2 = leave1 % (3600 * 1000); // 计算小时数后剩余的毫秒数
    const minutes = Math.floor(leave2 / (60 * 1000));

    // 计算相差秒数
    const leave3 = leave2 % (60 * 1000); // 计算分钟数后剩余的毫秒数
    const seconds = Math.round(leave3 / 1000);

    let result = '';
    if (days && days > 7) {
      result = moment(date)
        .locale('zh-cn')
        .format('YYYY-MM-DD');
    } else if (days && days >= 1 && days < 7) {
      result += `${days}天前`;
    } else if (hours && hours >= 1 && hours <= 23) {
      result += `${hours}小时前`;
    } else if (minutes && minutes >= 1 && minutes <= 59) {
      result += `${minutes}分钟前`;
    } else if (seconds && seconds >= 1 && seconds <= 59) {
      result += `${seconds}秒前`;
    } else {
      result = '1秒前';
    }
    return result;
  },
  fetchInstanceReasons(type) {
    const reasonsType = {
      UnknownContainerStatuses: '未知的容器状态',
      ContainersNotReady: '容器未就绪',
      ContainersNotInitialized: '容器尚未初始化'
    };
    return reasonsType[type] || type;
  },
  fetchInstanceAdvice(type) {
    const adviceType = {
      OutOfMemory:
        '内存不足, 建议为程序分配更多内存, 或检查程序是否合理使用内存',
      Unhealthy:
        '健康检测不通过, 请检查程序的端口是否可用, 以及健康检测配置是否正确',
      Initiating: '等待启动中, 请检查该组件所依赖的组件是否已经正常启动'
    };
    return adviceType[type] || type;
  },
  fetchOperation(finalstatus, status) {
    if (finalstatus === '') {
      return (
        <span style={{ color: '#F69C49', paddingLeft: '5px' }}>进行中</span>
      );
    }
    if (
      finalstatus === 'timeout' ||
      (finalstatus === 'complete' && status === 'timeout')
    ) {
      return <span style={{ color: 'rgba(0, 0, 0, 0.65)' }}>操作已超时</span>;
    }

    if (finalstatus === 'empty' || finalstatus === 'emptycomplete') {
      return <span />;
    }
    // eslint-disable-next-line default-case
    switch (status) {
      case 'success':
        return <span style={{ color: '#39AA56' }}>成功</span>;
      case 'failure':
        return <span style={{ color: '#F5212D' }}>失败</span>;
    }
  },
  fetchReason(type) {
    const status = {
      tenant_lack_of_memory: '超过租户限额',
      cluster_lack_of_memory: '集群资源不足'
    };
    if (type && status[type]) {
      return <span>(&nbsp;{status[type]}&nbsp;)</span>;
    }
    return type || '';
  },
  fetchAccessText(text) {
    const AccessText = {
      component: '组件管理',
      app: '应用管理',
      gatewayRule: '网关访问策略',
      certificate: '证书管理',
      plugin: '插件管理',
      teamMember: '团队成员管理',
      teamRole: '团队角色管理',
      teamRegion: '团队集群管理'
    };
    return AccessText[text] || text;
  },
  fetchAbnormalcolor(type) {
    const abnormalcolor = {
      AbnormalRecovery: '#39AA56',
      OOMKilled: '#CD0200',
      LivenessProbeFailed: '#CD0200',
      ReadinessProbeFailed: '#CD0200',
      AbnormalShtdown: '#CD0200',
      EventTypeAbnormalExited: '#CD0200',
      AbnormalExited: '#CD0200'
    };
    return abnormalcolor[type] || 'rgba(0,0,0,0.65)';
  },
  fetchStateOptTypeText(state) {
    const statusOptType = {
      deploy: '构建组件',
      delete: '删除组件',
      HorizontalUpgrade: '水平升级',
      VerticalUpgrade: '垂直升级',
      create: '创建组件',
      callback: '回滚',
      'git-change': '代码仓库修改',
      own_money: '欠费关闭',
      add_label: '添加标签',
      delete_label: '删除标签',
      service_state: '应用状态修改',
      reboot: '重启组件',
      market_sync: '云市同步',
      truncate: '删除组件',
      EventTypeAbnormalExited: '组件异常退出',
      OOMKilled: '发生OOM',
      LivenessProbeFailed: '健康检查不通过(重启)',
      ReadinessProbeFailed: '健康检查不通过(下线)',
      AbnormalShtdown: ' 组件异常退出',
      AbnormalExited: '组件异常退出',
      AbnormalRecovery: '恢复正常',
      '': '-',
      'create-service': '创建组件',
      'batch-build-service': '批量构建组件',
      'batch-start-service': '批量启动组件',
      'batch-stop-service': '批量停止组件',
      'batch-upgrade-service': '批量升级组件',
      'build-service': '构建组件',
      build: '构建组件',
      upgrade: '滚动升级组件',
      'update-service': '更新组件部署类型',
      'start-service': '启动组件',
      start: '启动组件',
      'add-app-autoscaler-rule': '添加自动伸缩规则',
      'update-app-autoscaler-rule': '更新自动伸缩规则',
      'stop-service': '停止组件',
      stop: '停止组件',
      'restart-service': '重启组件',
      restart: '重启组件',
      'vertical-service': '垂直扩展组件',
      vertical: '垂直扩展组件',
      'horizontal-service': '水平扩展组件',
      horizontal: '水平扩展组件',
      'stop-tennant': '停止租户',
      'set-language': '设置组件语言',
      'delete-service': '删除组件',
      'upgrade-service': '升级组件',
      'delete-buildversion': '删除构建版本',
      'share-service': '发布组件',
      'share-wb': '发布到内部市场',
      'share-ws': '发布到云端市场',
      'share-yb': '发布到市场',
      'share-ys': '发布到市场',
      updata: '更新组件',
      'add-app-service-monitor': '添加监控点',
      'add-service-dependency': '添加组件依赖',
      'delete-service-dependency': '删除组件依赖',
      'add-service-env': '添加组件环境变量',
      'update-service-env': '更新组件环境变量',
      'delete-service-env': '删除组件环境变量',
      'add-service-port': '添加组件端口',
      'update-service-port-old': '更新组件端口',
      'update-service-port': '更新组件端口',
      'delete-service-port': '删除组件端口',
      'handle-service-outerport': '修改组件对外端口',
      'handle-service-innerport': '修改组件对内端口',
      'change-service-lbport': '修改组件LB端口',
      'rollback-service': '回滚',
      'add-service-volume': '添加组件持久化存储',
      'update-service-volume': '更新组件持久化存储',
      'delete-service-volume': '删除组件持久化存储',
      'add-service-depvolume': '添加组件依赖存储',
      'delete-service-depvolume': '删除组件依赖存储',
      'add-service-probe': '添加组件探针',
      'update-service-probe': '更新组件探针',
      'delete-service-probe': '删除组件探针',
      'add-service-label': '添加组件标签',
      'update-service-label': '更新组件标签',
      'delete-service-label': '删除组件标签',
      'add-thirdpart-service': '添加第三方组件',
      'update-thirdpart-service': '更新第三方组件',
      'delete-thirdpart-service': '删除第三方组件',
      'update-service-gateway-rule': '更新组件网关规则',
      'app-restore-envs': '重新加载应用环境变量',
      'app-restore-ports': '重新加载应用端口',
      'app-restore-volumes': '重新加载应用存储',
      'app-restore-probe': '重新加载应用探针',
      'app-restore-deps': '重新加载应用依赖',
      'app-restore-depvols': '重新加载应用依赖存储',
      'app-restore-plugins': '重新加载应用插件',
      'create-service-plugin': '创建组件插件',
      'update-service-plugin': '更新组件插件',
      'delete-service-plugin': '删除组件插件',
      'update-service-plugin-config': '更新组件插件配置'
    };
    return statusOptType[state] || state;
  },
  replaceUrlTeam(team) {
    let { href } = location;
    const reg = /team\/([^/]+)/;
    href = href.replace(reg, (string, g1) =>
      string.replace(new RegExp(g1), team)
    );
    return href;
  },
  replaceUrlRegion(region) {
    let { href } = location;
    const reg = /region\/([^/]+)/;
    href = href.replace(reg, (string, g1) =>
      string.replace(new RegExp(g1), region)
    );
    return href;
  },
  replaceUrlTeamAndTegion(team, region) {
    let { href } = location;
    const reg = /team\/([^/]+)\/region\/([^/]+)/;
    href = href.replace(reg, (string, g1, g2) =>
      string.replace(new RegExp(g1), team).replace(new RegExp(g2), region)
    );
    return href;
  },
  getSupportComponentTyps() {
    return [
      {
        type: 'state_singleton',
        name: this.getComponentType('state_singleton'),
        desc: '部署为Statefulset类型，一般用于DB类，消息中间件类，数据类组件 '
      },
      {
        type: 'state_multiple',
        name: this.getComponentType('state_multiple'),
        desc: '可多实例运行的有状态组件'
      },
      {
        type: 'stateless_singleton',
        name: this.getComponentType('stateless_singleton'),
        desc: '部署为Deployment, 一般用于Web类，API类等组件，不可扩展实例数'
      },
      {
        type: 'stateless_multiple',
        name: this.getComponentType('stateless_multiple'),
        desc: '可多实例运行的无状态组件'
      }
    ];
  },
  getComponentType(componentType) {
    switch (componentType) {
      case 'state_singleton':
        return '有状态单实例';
      case 'state_multiple':
        return '有状态多实例';
      case 'stateless_singleton':
        return '无状态单实例';
      case 'stateless_multiple':
        return '无状态多实例';
      default:
        return '';
    }
  },
  isStateComponent(componentType) {
    if (
      componentType === 'state_singleton' ||
      componentType === 'state_multiple'
    ) {
      return true;
    }
    return false;
  },
  isSingletonComponent(componentType) {
    if (
      componentType === 'state_singleton' ||
      componentType === 'stateless_singleton'
    ) {
      return true;
    }
    return false;
  }
};

export default global;
